package com.fengyuncx.tp.ali_plugin.demo;

import com.alibaba.ha.adapter.AliHaConfig;
import com.fengyuncx.tp.ali_crash_report.AliCrashReportPlugin;
import com.fengyuncx.tp.ali_crash_report.GlobalThreadManager;

import io.flutter.app.FlutterApplication;

public class MyApplication extends FlutterApplication {

    @Override
    public void onCreate() {
        super.onCreate();
        initHa();
        GlobalThreadManager.init(this);
    }

    private void initHa() {
        AliHaConfig config = new AliHaConfig();
        config.appKey = "your appKey";
        config.appVersion = BuildConfig.VERSION_NAME;
        config.appSecret = "your appSecret";
        //渠道（字母数字非中文）
        config.channel = "android";
        //昵称（字母数字非中文）
        config.userNick = null;
        config.application = this;
        config.context = getApplicationContext();
        config.isAliyunos = false;
        //启动CrashReporter
        AliCrashReportPlugin.init(config);
    }
}
